package com.uobgroup.ews.uam.core.service;

import com.uobgroup.ews.uam.core.dao.ApplicationConfigurationDao;
import com.uobgroup.ews.uam.core.domain.ApplicationConfiguration;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class ApplicationConfigurationServiceImpl implements ApplicationConfigurationService {

   @Autowired
   ApplicationConfigurationDao applicationConfigurationDao;

   public long countAllApplicationConfigurations() {
      return applicationConfigurationDao.count();
   }

   public void deleteApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
      applicationConfigurationDao.delete(applicationConfiguration);
   }

   public ApplicationConfiguration findApplicationConfiguration(Long id) {
      return applicationConfigurationDao.findOne(id);
   }

   public List<ApplicationConfiguration> findAllApplicationConfigurations() {
      return applicationConfigurationDao.findAll();
   }

   public List<ApplicationConfiguration> findApplicationConfigurationEntries(int firstResult, int maxResults) {
      return applicationConfigurationDao.findAll(firstResult, maxResults);
   }

   public void saveApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
      applicationConfigurationDao.save(applicationConfiguration);
   }

   public ApplicationConfiguration updateApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
      return applicationConfigurationDao.update(applicationConfiguration);
   }
   public List<ApplicationConfiguration> findUsernameDomain(String applicationConfigKey)
   {
	   return applicationConfigurationDao.findUsernameDomain(applicationConfigKey);
   }
}
